package com.springboot.framework.mvc.mapper.driver;

import org.apache.ibatis.mapping.SqlSource;
import org.apache.ibatis.scripting.LanguageDriver;
import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver;
import org.apache.ibatis.session.Configuration;


/**
 * 自定义 基础mapper查询驱动
 *
 */
public class BaseMapperDriver extends XMLLanguageDriver implements LanguageDriver {

    @Override
    public SqlSource createSqlSource(Configuration configuration, String script, Class<?> parameterType) {
        /* 对sql进行解析处理 */
        BaseMapperDriverResolver baseMapperDriverResolver = new BaseMapperDriverResolver();
        script = baseMapperDriverResolver.createSqlSource(configuration,script);
        return super.createSqlSource(configuration, script , parameterType);
    }
}
